﻿#include "sentencenode.h"

SentenceNode::SentenceNode(AbstractNode* left, AbstractNode* mid, AbstractNode* right) : AbstractNode()
{
    m_left = left;
    m_mid = mid;
    m_right = right;
}

uint8_t SentenceNode::interpret()
{
    if (m_mid->interpret() == '&') {
        return m_left->interpret() & m_right->interpret();
    } if (m_mid->interpret() == '|') {
        return m_left->interpret() | m_right->interpret();
    }
    return 0;
}
